<?php

namespace App\Http\Requests;
/**
 * 微信应用-表单验证类
 * @package App\Http\Requests
 */
class AdminWxMpListPost extends AdminBaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'type' => 'required|in:1,2,3',
            'appid' => 'required',
            'secret' => 'required',
            'token' => 'required',
            'nick_name' => 'required',
            'head_img' => 'required',
            'is_enable' => 'in:0,1',
        ];
    }
    /**
     * 定义错误消息
     * @return array
     */
    public function messages()
    {
        return [
            'type.required' => '请选择应用类型',
            'appid.required' => '请输入AppID',
            'secret.required' => '请输入AppSecret',
            'token.required' => '请输入应用Token',
            'nick_name.required' => '请填写应用名称',
            'head_img.required' => '请上传应用头像',
            'is_enable.in' => '请选择应用使用状态',
        ];
    }
}
